]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenshot: End screencast with same keybinding as start screencast
authorIan Off <atimeofday@gmail.com>
Thu, 21 Aug 2025 04:27:43 +0000 (23:27 -0500)
committerMarge Bot <marge-bot@gnome.org>
Fri, 5 Dec 2025 22:07:18 +0000 (22:07 +0000)
Currently, the screencast keyboard shortcut shows the UI to begin a
screencast, but there is no way to end it with a keyboard shortcut.

This behavior is inconvenient and seems to be a regression, as a wide
variety of online resources recommend using the same shortcut to start
and end screencasts.

This commit introduces a simple check when the showScreenRecordingUI
function is called by the show-screen-recording-ui keybinding.
If the showScreenRecordingUI function is called while a screencast
is in progress, the stopScreencast function is called instead
of opening the screenshot UI in screencast mode.

Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5386

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3847>

js/ui/screenshot.js

index 2e6b2cf4f1407c7ab341047605e17821a8637e75..60dedd68b7bd40d981139556c6cd142317cecf58 100644 (file)
@@ -1428,7 +1428,12 @@ export const ScreenshotUI = GObject.registerClass({
             new Gio.Settings({schema_id: 'org.gnome.shell.keybindings'}),
             Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
             restrictedModes,
-            showScreenRecordingUI
+            () => {
+                if (this._screencastInProgress)
+                    this.stopScreencast();
+                else
+                    showScreenRecordingUI();
+            }
         );
 
         Main.wm.addKeybinding(